package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @program: sky-take-out
 * @description:
 * @author: fmp
 * @create: 2023-04-09 15:10
 * @Version 1.0
 **/
@Mapper
public interface OrderMapper {

    //订单信息添加
    void submitOrders(@Param("orders") Orders orders);
    /**
     * 基于订单Id与用户Id查询订单
     *
     * @param userId      用户Id
     * @param orderNumber 订单编号
     * @return 订单基本信息
     */
    Orders selectOrderByOrderNumberAndUserId(@Param("userId") Long userId, @Param("orderNumber") String orderNumber);
    /**
     * 更新订单信息
     * @param orders 更新后的订单信息(包含Id)
     */
    void updateOrder(@Param("orders") Orders orders);
    //返回id
    Page<Orders> selectOrderIds(@Param("userId") Long userId);
    //根据id查询
    Orders selectOrderById(@Param("id") Long id);
    //通过状态查询
    List<Orders> selectOrderByStatus(@Param("pendingPayment") Integer pendingPayment, @Param("localDateTime") LocalDateTime localDateTime);

}
